package org.example.ExperimentFour.First;
//
//public class Student {
//    private String name;
//    private int  age;
////    无参构造
//    public Student(){
//    }
////    有参构造
//    public  Student(String name,int age){
//        this.name=name;
//        this.age=age;
//    }
////    getName
//    public String getName(){
//        return name;
//    }
////    getAge
//    public  int getAge(){
//        return age;
//    }
////公有    show
//    public  void layInfo(){
//        System.out.println("这是一个公有方法");
//
//    }
////   私有
//private void privateMethod(){
//        System.out.println("这是一个私有方法");
//    }
//}
public class Student {
    private String name;
    private int age;
    public Student() {
        this.name = "Unknown";
        this.age = 0;
    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public String getName() {
        return name;
    }
    public int getAge() {
        return age;
    }
    public void displayInfo() {
        System.out.println("Name: " + name + ", Age: " + age);
    }
    private void privateMethod() {
        System.out.println("Private method called");
    }
}
